import request from '@/axios'

export function list(query) {
    return request({
        url: '/user/list',
        method: 'post',
        data: query
    })
}

export function down(data) {
    data.json  = true
    let config = {
        responseType: 'arraybuffer',
    }
    let url =  '/user/down'
    return request.post(url,data,config)
}

export function changeVip(query) {
    return request({
        url: '/user/vip',
        method: 'post',
        data: query
    })
}

export function info(id) {
    return request({
        url: '/user/info/' + id,
        method: 'get'
    })
}

export function save(data) {
    return request({
        url: '/user/save',
        method: 'post',
        data
    })
}

export function update(data) {
    data.json = true
    return request({
        url: '/user/update',
        method: 'post',
        data
    })
}

export function remove(data) {
    return request({
        url: '/user/delete',
        method: 'post',
        data
    })
}

export function all(){
    return request({
        url: '/user/queryAll',
        method: 'get'
    })
}


//转账
export function transfer(data) {
    let url = '/user/account/'
    return request.post(url,data)
}
